package com.cloudsigns.factorymanager2.engineering.activity;

import android.app.Activity;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.ScrollView;
import android.widget.TextView;

import com.cloudsigns.factorymanager2.R;
import com.cloudsigns.factorymanager2.engineering.adapter.DailyFeedBackForEngineeringInstallAdapter;
import com.cloudsigns.factorymanager2.engineering.adapter.MediaForRegionDetailForManagerAdapter;
import com.cloudsigns.factorymanager2.engineering.bean.EngineeringDailyFeedBackBean;
import com.cloudsigns.factorymanager2.engineering.bean.RegionBean;
import com.cloudsigns.factorymanager2.project.utils.DateUtil;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * 机场详情页 管理员
 * Created by tony on 2018/5/12.
 */

public class RegionDetailForManagerActivity extends Activity implements View.OnClickListener {
    private View rl_back;
    private TextView tv_title;
    private LinearLayout ll_area;
    private ScrollView scrollview;
    private RegionBean regionBean;
    private LayoutInflater layoutInflater;
    private final String TAG = RegionDetailForManagerActivity.class.getSimpleName();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏
        // 沉浸式状态栏
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            Window window = getWindow();
            window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
                    );
            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN

                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            window.setStatusBarColor(Color.TRANSPARENT);

        } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        }
        setContentView(R.layout.layout_region_detail_for_manager);

        init();
    }

    private void init() {
        rl_back = findViewById(R.id.rl_back);
        tv_title = findViewById(R.id.tv_title);
        ll_area = findViewById(R.id.ll_area);
        scrollview = findViewById(R.id.scrollview);

        tv_title.setText("工单信息");
        rl_back.setOnClickListener(this);

        layoutInflater = getLayoutInflater();

    }

    private void initData() {

    }

    private void updateUi() {
        if (null != regionBean) {
//            for (String date : dayStrList) {
            View view = layoutInflater.inflate(R.layout.lv_region_detail_for_manager_area, null);
            TextView tv_name = view.findViewById(R.id.tv_name);
            TextView tv_patrol_cycle = view.findViewById(R.id.tv_patrol_cycle);
            TextView tv_area_name = view.findViewById(R.id.tv_area_name);
            ListView lv_media = view.findViewById(R.id.lv_media);

            MediaForRegionDetailForManagerAdapter adapter = new MediaForRegionDetailForManagerAdapter(this, TAG);
            lv_media.setAdapter(adapter);


            ll_area.addView(view);


//            }
        }

        scrollview.smoothScrollTo(0, 0);

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.rl_back:
                finish();
                break;
        }
    }
}
